export default {
  props: {
    value: [String, Number],
    title: [String],
    placeholder: [String],
    disabled: {
      type: Boolean,
      default: false,
    },
    isNoSpace: {
      type: Boolean,
      default: true,
    },
    maxlength: [Number, String],
    isNumber: [Boolean],
    rightText: [Number, String],
  },
  
  data() {
    return {
      isFocus: false,
    };
  },
  watch: {
    inpValue(value) {
     
      if(this.isNoSpace){
        this.inpValue = value.replace(/\s+/g, '');
      }
      if (this.isNumber) {
        this.inpValue = value.replace(/[^0-9]/g, '');
      }
    },
  },
  computed: {
    inpValue: {
      get() {
        return this.value;
      },
      set(value) {
        this.$emit('input', value);
      },
    },
  },
};
